home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-20 / rs0422.zip / ROSEZSW / RZSW.AS < prev    next >
Text File  |  1991-04-22  |  5KB  |  187 lines

  1.     psect    data
  2.     global    _node_addr, _l2_user_info, _l2_info, Copyright
  3.     global    _L3CALL,_L3DIGI, _L3PORT, _L3_MAXVC, _L3_WI, _L3DELAY
  4.     global    _L3CSIZ, _L3NSIZ, _NPAroute, _userport
  5.     global     _l2parms, _dl2parms, _l3parms, _dl3parms
  6.     global    _USER_MAXVC, _USER_L3_W, _RTable
  7.     global    _sumchk, __Lbssck, mycall, mydigi, myaddr
  8.     global    _NULLFCN, _clr_boot, _con_boot, _recv_boot
  9.     global    _rst_boot, _send_boot, _loader
  10.     global    _complete, _being_set
  11.     global    _Entry, _entry
  12.     global    _passlen, _passwd
  13.  
  14. initdta:
  15. myaddr:    defb    10,31h,00h,00h,00h,00h,00h    ;node address
  16.     defw    _l2_info            ;dummies message
  17.     defw    l2parms                ;l2 user config
  18.     defw    l3parms                ;l3 link config
  19.     defw    4                ;L3 user pkt window
  20.     defw    5                ;L3 user max vc cnt
  21.     defw    15                ;_L3CSIZ, no L3 users
  22. initlen    equ    $-initdta
  23.  
  24. Copyright: defm    '(C) 1988-90 W2VY'
  25. _l2_info: defw    0,0,l2rdta,l2wdta,l2eob
  26. l2rdta:    defm    'ROSE X.25 Packet Switch Version 910422 by Thomas A. Moulton, W2VY'
  27. l2eob:    defb    0dh
  28. l2wdta:    defm    'See READZSW.ME in RZSW1111.ZIP !!!!'    ;35 Bytes
  29.     defb    0dh,0,0,0,0,0,0                ;7 Bytes
  30.     defb    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0    ;18 Bytes = 60 Bytes
  31.  
  32. _complete: defm    'Call Completed to '    ;40 bytes for each message
  33.     defb    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  34. _being_set: defm 'Call being Setup\r'
  35.     defb    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  36.  
  37. AXALEN    equ    7
  38. nnodes    equ    1    ;1 nodes in default config
  39. nusers    equ    0    ; No Level 3 users in default config
  40. maxl3    equ    24    ; My Calls + 15 Node Paths + 8 Users
  41.  
  42.     GLOBAL    _maxl3dev
  43. _maxl3dev: defw    maxl3    ;Tell rest of world how big it is
  44.  
  45. mycall:    defb    0a4h,9eh,0a6h,08ah,040h,40h,66h    ;ROSE-3
  46. mydigi:    defb    0a4h,9eh,0a6h,08ah,040h,40h,64h    ;ROSE-2
  47. myport:    defb    0
  48. mydelay: defw    0        ;900 =15 Mins before retry network link
  49. myvc:    defb    20        ;network links can have 20 vc's default
  50. mywi:    defb    4        ;default window of 4
  51.  
  52. spfcn:    defw    1,_loader
  53. defpwd:    defb    0,0        ;40 Bytes for KEY
  54.     defm    'ROSEISBESTABCDEFGHIJKLMNOPQRSTUVWXYZW2VY'
  55.  
  56. initab:    defw    FLAG2-BSSCK-1,BSSCK+1,BSSCK    ;Length, Dest, Src
  57.     defw    initlen,initbss,initdta
  58.     defw    7*nnodes,_L3CALL,mycall
  59.     defw    7*nnodes,_L3DIGI,mydigi
  60.     defw    nnodes,_L3PORT,myport
  61.     defw    nnodes,_L3_MAXVC,myvc
  62.     defw    nnodes,_L3_WI,mywi
  63.     defw    nnodes*2,_L3DELAY,mydelay
  64.     defw    12,l2parms,_dl2parms    ;init l2 parms ram table
  65.     defw    12,l3parms,_dl3parms    ;init l3 parms ram table
  66.     defw    42,_passlen,defpwd
  67. initwm:    defw    4,_maxfcn, spfcn    ;Application loader
  68.     defw    10,_L2PARS,_dL2PARS    ;Hooks for Level 2 User Switching
  69.     defw    10,_L3PARS,_dL3PARS    ;Hooks for Level 3 Switching
  70.     defw    8,_ifaces,_difaces    ;Level 1 to Level 2 Hooks 4 ports
  71.     defw    10,_entry,_Entry    ;Message for Loader
  72.     defw    0
  73.  
  74.     psect    text
  75.     global    __init
  76. __init:
  77.     ld    a,(FLAG1)    ;check flags
  78.     cp    0aah
  79.     jp    nz,1f
  80.     ld    a,(FLAG2)
  81.     cp    0aah
  82.     jp    nz,1f
  83.     call    sumchk        ;compute the checksum (xor of bytes)
  84.     ld    b,a
  85.     ld    a,(BSSCK)
  86.     cp    b
  87.     jp    nz,1f
  88.     ld    hl,_l2_info
  89.     ld    (_l2_user_info),hl    ;Only the default message is in rom
  90.     ld    hl,initwm        ;Warm Start init's
  91.     jp    initlp
  92.  
  93. 1:    xor    a        ;Clear A
  94.     ld    (BSSCK),a    ;IPAGE and MEMSIZ are set elsewhere
  95. ;
  96.     ld    hl,initab    ;start of init table
  97. initlp:    ld    c,(hl)
  98.     inc    hl
  99.     ld    b,(hl)
  100.     inc    hl
  101.     ld    a,b
  102.     or    c        ;done yet?
  103.     jp    z,initeof    ;yes, get out!
  104.     ld    e,(hl)
  105.     inc    hl
  106.     ld    d,(hl)
  107.     inc    hl
  108.     ld    a,(hl)
  109.     inc    hl
  110.     push    hl
  111.     ld    h,(hl)
  112.     ld    l,a
  113.     ldir
  114.     pop    hl
  115.     inc    hl
  116.     jp    initlp
  117.  
  118. initeof:
  119.     ld    a,0aah
  120.     ld    (FLAG1),a
  121.     ld    (FLAG2),a
  122.  
  123. ;            Now set the checksum value for next time.
  124. _sumchk:
  125.     call    sumchk
  126.     ld    (BSSCK),a
  127.     ret
  128.  
  129. sumchk:
  130.     ld    hl,FLAG1
  131.     ld    bc,FLAG2-FLAG1
  132.     ld    a,(hl)
  133.     inc    hl
  134.     push    hl
  135.     pop    de        ;source and dest same, the LD is a nop
  136. 1:    xor    (hl)
  137.     ldi
  138.     ret    po        ;until BC = 0
  139.     jp    1b
  140.  
  141.     psect    bssck        ;bss with checksum protection
  142.     global    IPAGE, _MEMSIZ, _HEAPUSD, _HEAPSIZ, _COLD
  143. IPAGE:    DEFS    256        ;Interrupt pointer table (HDWINT.AS)
  144. _MEMSIZ: DEFS    2        ;Size of Dynamic RAM (BOOT.AS)
  145. _COLD:    defs    1        ;Reason for Restart (BOOT.AS)
  146. BSSCK:    defs    1
  147. FLAG1:    defs    1
  148. l2parms: defs 12
  149. l3parms: defs 12
  150. initbss:
  151. _node_addr: defs AXALEN
  152. _l2_user_info: defs 2
  153. _l2parms: defs 2
  154. _l3parms: defs 2
  155. _USER_L3_W: defs 2
  156. _USER_MAXVC: defs 2
  157. _L3CSIZ: defs 2
  158. _L3CALL: defs AXALEN*maxl3    ;7 * 18 - 16 Nodes and 8 Users (bbs?)
  159. _L3DIGI: defs AXALEN*maxl3
  160. _L3PORT: defs 2*maxl3
  161. _L3_WI:  defs 2*maxl3
  162. _L3_MAXVC: defs maxl3
  163. _L3DELAY: defs 2*16    ;2 * 16    Nodes only
  164. _L3NSIZ: defs 2
  165. _NPAroute: defs 256        ;16 * 16 Alternatives in routing list
  166. _userport: defs 2        ;Port number for out-bound User connect requests
  167. _RTable: defs    2048        ;2K Max Routing Table for the WORLD!
  168. _passlen: defs    1
  169. _passwd: defs    256
  170. FLAG2:    defs    1
  171.     psect    bss
  172.     global    _Init_bss, _SAVE, _SAVEA, _taskq, _timerq, _spcfcn, _maxfcn
  173.     global    _ifaces, _L2PARS, _L3PARS, _difaces, _dL2PARS, _dL3PARS
  174. _Init_bss:
  175. _HEAPUSD: defs 2
  176. _HEAPSIZ: defs 2
  177. _taskq: defs 2
  178. _timerq: defs 2
  179. _ifaces: defs 8        ;4 pointers (2 bytes each)
  180. _L2PARS: defs 10    ;5 pointers (2 bytes each)
  181. _L3PARS: defs 10    ;5 pointers (2 bytes each)
  182. _SAVE: defs 2
  183. _SAVEA: defs 16
  184. _maxfcn: defs 2
  185. _spcfcn: defs 32    ; 16 - 2 byte entries
  186.     end
  187.